//
// Created by Zhangwj on 2023/9/25.
//

#include "FuncTypeNode.h"

std::unique_ptr<FuncTypeNode> FuncTypeNode::FuncTypeParser(Parser &parser) {
    //FuncType → 'void' | 'int'
    std::unique_ptr<FuncTypeNode> funcTypeNode = std::make_unique<FuncTypeNode>();
    if (parser.getLexType(0) == LexType::VOIDTK) {
        funcTypeNode->type = LexType::VOIDTK;
        parser.next();
    } else if (parser.getLexType(0) == LexType::INTTK) {
        funcTypeNode->type = LexType::INTTK;
        parser.next();
    }
    return funcTypeNode;
}
